package com.cs.statistic.beans;

public class OptionBean {

    public static final int OPTION_INDEX_IMMEDIATELY_CARE_SWITCH = 0;
    public static final int OPTION_INDEX_POSITION = 1;
    public static final int OPTION_INDEX_ABTEST = 2;
    public static final int OPTION_INDEX_IMMEDIATELY_ANYWAY = 3;
    private int mOptionID = -1;
    private Object mOptionContent = null;

    public OptionBean(int optionID, Object optionContent) {
        this.mOptionID = optionID;
        this.mOptionContent = optionContent;
        this.checkOptionContentType();
    }

    public int getOptionID() {
        return this.mOptionID;
    }

    public Object getOptionContent() {
        return this.mOptionContent;
    }

    private void checkOptionContentType() {
        if ((this.mOptionID == 3 || this.mOptionID == 0) && !(this.mOptionContent instanceof Boolean)) {
            throw new IllegalArgumentException("Immediately argument must be 'true' or 'false'");
        } else if ((this.mOptionID == 2 || this.mOptionID == 1) && !(this.mOptionContent instanceof String)) {
            throw new IllegalArgumentException("Position or ABTest argument type must be String");
        }
    }

}
